//
// @Auther: by wujehy 
// @Email:wujehy@qq.com
// @Data:2020/9/11
// @Time:3:57 下午
//
//

#ifndef GEEJOAN_CLIENTMODMANAGER_H
#define GEEJOAN_MODMANAGER_H

#include "BaseComponent.h"
#include "NetworkProtocol.h"
#include <map>

namespace GeeJoan
{
    class BaseMod;

    class ModManager : public BaseComponent
    {
        std::map<ModTypeEnum, BaseMod *> m_mod_map;

        void registerMOD();

    public:
        void init() override;

        void init_complete(Global_Context *context) override;

        /**
         * @brief 路由
         * @param hander 处理的类型
         */
        void rounte(std::unique_ptr<HanderDataType> hander);

        bool registerModFunc(BaseMod *mod, bool auto_del = true);

        virtual ~ModManager();
    };
}

#endif //GEEJOAN_CLIENTMODMANAGER_H
